<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserlibrariesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('userlibraries', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
            //创建用户名字段，且不可为空
            $table->string('username')->unique();
            //创建密码字段
            $table->string('password');
            //创建邮箱字段
            $table->string('email');
            //创建手机号码字段
            $table->string('phone_number',100);
            //创建用户身份字段
            $table->string('identity');
            //创建全部作品数量字段
            $table->integer('all_original');
            //创建已发布作品数量字段
            $table->integer('original_book');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('userlibraries');
    }
}
